import axios from "axios";
import storage from "../storage";

export const updateUserInfo = async () => {
    let res = await axios.get('member/index')
    res = res.data
    if(res.status==200){
        const data = res.data
        console.log(data)
        storage.set('user',JSON.stringify(data))
        // this.resetSetItem('user',JSON.stringify(data) );
        storage.set('username',data.username);
        storage.set('sex',data.sex);
        storage.set('email',data.email);
        storage.set('mobile',data.mobile);
        localStorage.setItem('username',data.username);
        localStorage.setItem('remain_days',data.remain_days);
        //this.$router.push({name:'UserWork',params:{create_time:this.create_time}})
        return data;
    }
    return false;
}